import Vue from 'vue'
import VueRouter from 'vue-router'
import Films from '../views/Films'
import Aritcle from '../views/Article'
import Center from '../views/Center'
import MovieDetail from '../views/Films/MovieDetail.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/films',
    name: 'Films',
    component: Films,
    meta: {
      isNav: true
    },
    children: [
      {
        path: "nowPlaying",
        component: () => import('../views/Films/children/NowPlaying')
      },
      {
        path: "comingSoon",
        component: () => import('../views/Films/children/ComingSoon')
      }
    ]
  },
  {
    path: '/article',
    name: 'About',
    component: Aritcle,
    meta: {
      isNav: true
    }
  }, {
    path: "/center",
    name: "Center",
    component: Center,
    meta: {
      isNav: true
    }
  }, {
    path: "/movie/:id",
    name: "MovieDetail",
    component: MovieDetail
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
